package com.punch.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.punch.common.vo.order.StudentSignUpVO;
import com.punch.common.vo.registration.RegistrationVO;
import com.punch.order.model.OrderCourseSnapshot;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * CourseOrderMapper
 *
 * @author xiaol
 * @version 1.0.0
 * @since 2020/8/5 22:55
 */
@Mapper
public interface CourseOrderMapper extends BaseMapper<OrderCourseSnapshot> {
    /**
     * 根据班级id查询班级报名情况count
     *
     * @param params
     * @return
     */
    Integer queryRegistrationCount(Map<String, Object> params);

    /**
     * 根据班级id查询班级报名情况记录
     *
     * @param params
     * @return
     */
    List<RegistrationVO> queryRegistrationList(Map<String, Object> params);

    /**
     * 更新该课程下开班的课程订单的已完成课时数
     *
     * @param courseId 课程id
     * @param classId  班级id
     * @return boolean
     */
    Boolean updateClassFinishCount(@Param("courseId") Long courseId, @Param("classId") Long classId);

    Integer queryStudentSignUpCount(Map<String, Object> params);

    List<StudentSignUpVO> queryStudentSignUpList(Map<String, Object> params);

    /**
     * 运营修改开班时间
     *
     * @param classId  课程id
     * @param openDate 开班时间
     */
    void updateOpenDate(@Param("classId") Long classId, @Param("openDate") LocalDate openDate);

    /**
     * 运营修改教师
     *
     * @param classId     课程id
     * @param teacherName 教师名称
     */
    void updateTeacher(@Param("classId") Long classId, @Param("teacherName") String teacherName);

    /**
     * 运营修改教室
     *
     * @param classId       课程id
     * @param classRoomName 教室
     */
    void updateClassRoom(@Param("classId") Long classId, @Param("classRoomName") String classRoomName);
}
